---
---
<!-- this URL: ce-ee-install-ubuntu-prereq -->
<!-- title: Ubuntu: Installing Required Prequisite Software for Magento CE 1.8 Magento EE 1.13 (or Later) -->

<html lang=en>

<head>
    <meta charset=utf-8>

    <link rel="stylesheet" type="text/css" href="{{ site.baseurl }}/common/css/stylesheet.css"/>
    <link rel="stylesheet" href="{{ site.baseurl }}/common/css/stylesheet-fonts.css" type="text/css" charset="utf-8">
    <link rel="icon" href="{{ site.baseurl }}/common/css/favicon.ico" type="image/x-icon">
    <link rel="shortcut icon" href="{{ site.baseurl }}/common/css/favicon.ico" type="image/x-icon">
    <title>Ubuntu: Installing Required Prerequisite Software for Magento CE 1.8 Magento EE 1.13 (or Later)</title>

</head>

<body>

<img src="{{ site.baseurl }}/guides/m1x/images/m1xheader.png" width="1024" alt="header" />
{% include m1x/eol_message.html %}


<h1>Ubuntu: Installing Required Prerequisite Software for Magento CE 1.8 Magento EE 1.13 (or Later)</h1>
<p><a href="{{ site.m1xgithuburl }}/install/installing_req-prereq_ubuntu.html" target="_blank">Edit this page on GitHub <img src="{{ site.baseurl }}/common/images/github_icon.png" height="15px"></a></p>


<div id="content"> 

<div class="toc"> <h4 class="toc">Contents</h4>
<ul>
<li><a href="#overview">Overview</a></li>
<li><a href="#update-system">Updating System Software</a></li>
<li><a href="#apache">Apache</a></li>
<li><a href="{{ site.m1xgdeurl }}/install/nginx.html" target="_blank">nginx</a></li>
<li><a href="#php">PHP</a></li>
<li><a href="#mysql">MySQL</a></li>
<li><a href="#next">Next Steps</a></li>

</ul> </div>

<h2 id="overview">Overview</h2>
<p>This article discusses how to install required prerequisite software for Ubuntu. You must complete these tasks before you install Magento CE 1.8 or later or Magento EE 1.13 or later.</p>
<p>Before you continue, make sure you familiarize yourself with the installation process discussed in <a href="{{ site.m1xgdeurl }}/install/installing_install.html#prereq">Prerequisites</a>.</p>
<div class="msg-box important"><img src="{{ site.baseurl }}/guides/m1x/images/icon-note.png" alt="note" align="left" width="40"><span><strong>Note</strong>: You must install system software on Ubuntu as a user with <code>root</code> privileges.</div>


<h2 id="update-system">Updating System Software</h2>
<p>It's a good practice to update your repositories and system software, if necessary.</p>
<p>Log in to your Magento server as a user with <code>root</code> privileges and enter the commands shown in this section.</p>
<p>Update repositories:</p>
<pre>apt-get update</pre>
<p>Optionally upgrade software. This might require a system reboot.</p>
<pre>apt-get upgrade</pre>

<h2 id="apache">Apache</h2>
<p>This section discusses how to install Apache. For more details, you can consult a reference like the <a href="https://help.ubuntu.com/lts/serverguide/httpd.html" target="_blank">Ubuntu site</a>.</p>
<p>Magento requires Apache use server rewrites. You must also specify the type of directives that can be used in <code>.htaccess</code>, which Magento uses to specify rewrite rules.</p>
<p>Installing and configuring Apache is basically a three-step process: install the software, enable rewrites, and specify <code>.htaccess</code> directives.</p>

<h3 id="apache-install">Installing Apache</h3>
<p>Install Apache 2 if you haven't already done so:</p>
<pre>apt-get -y install apache2</pre>

<h3 id="apache-rewrites">Enabling Apache Rewrites</h3>
<p>Ubuntu 12 (which natively supports Apache 2.2) is different from Ubuntu 14 (which natively supports Apache 2.4).</p>
<p>It's very important you choose a value for <code>AllowOverride</code> that is suited to your deployment. You can use <code>AllowOverride All</code> in development but it might not be desirable in production.</p>
<p>For more information, see one of the following references:</p>
<ul><li><a href="http://httpd.apache.org/docs/2.2/mod/core.html#allowoverride" target="_blank">Apache 2.2</a></li>
<li><a href="http://httpd.apache.org/docs/current/mod/core.html#allowoverride" target="_blank">Apache 2.4</a></li></ul>

<h4 id="apache-rewrites2.2">Enabling Apache Rewrites for Apache 2.2</h4>
<p>Use this section to enable Apache rewrites and specify <code>.htaccess</code> if you use Apache 2.2, which is supported by the default Ubuntu 12 repository.</p>
<ol><li>Open the following file for editing.
<pre>vim /etc/apache2/sites-available/default</pre></li>
<li>Locate the following block.
<pre>&lt;Directory /var/www/>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride None
    Order allow,deny
    allow from all
&lt;/Directory></pre></li>
<li>Change the value of <code>AllowOverride</code> to <code>[value from Apache site]</code>.
<pre>&lt;Directory /var/www/>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride All
    Order allow,deny
    allow from all
&lt;/Directory></pre></li>
<li>Save the file and exit the text editor.</li>
<li>Configure Apache to use the <code>mod_rewrite</code> module.<br>
<pre>cd /etc/apache2/mods-enabled
ln -s ../mods-available/rewrite.load</pre></li>
<li>Restart Apache.<br>
<pre>service apache2 restart</pre></li></ol>

<h4 id="apache-rewrites2.4">Enabling Apache Rewrites for Apache 2.4</h4>
<p>Use this section to enable Apache rewrites and specify <code>.htaccess</code> if you use Apache 2.4, which is supported by the default Ubuntu 14 repository.</p>
<ol><li>Enter the following command:<br>
<pre>a2enmod rewrite</pre></li>
<li>Specify the type of directives that can be used in <code>.htaccess</code>.<br>
For guidelines, see the <a href="http://httpd.apache.org/docs/current/mod/mod_rewrite.html" target="_blank">Apache 2.4 documentation</a>.<br>
Note that in Apache 2.4, the server's default site configuration file is <code>/etc/apache2/sites-available/000-default.conf</code><br>
For example, you can add the following to the bottom of <code>000-default.conf</code>:<br>
<pre>&lt;Directory "/var/www">
AllowOverride [value from Apache site]
&lt;/Directory></pre>
<strong>Note</strong>: You must change the value of <code>AllowOverride</code> in the directive for the directory to which you expect to install the Magento software. For example, to install in the web server docroot, edit the directive in <code>&lt;Directory /var/www></code>.</li>

<li>Restart Apache:<br>
<code>service apache2 restart</code></li></ol>

<h2 id="php">PHP</h2>
<p>Magento CE and EE support the following PHP versions:</p>
<ul><li>Magento CE 1.6.0.0&ndash;1.8.1.0 and Magento EE 1.11.0.0&ndash;1.13.1.0 support PHP 5.3 natively. They can be used with PHP 5.4 if you apply the <a href="{{ site.m1xgdeurl }}/other/php5.4_patch.html" target="_blank">PHP 5.4 patch</a>.</li>
<li>Magento CE 1.9.0.x and EE 1.14.0.x support PHP 5.4 natively. They are backward-compatible with PHP 5.3</li>
<li>Magento CE 1.9.1 and EE 1.14.1 support PHP 5.5 natively. They are backward-compatible with PHP 5.4</li></ul>
<p>We recommend you use the most recent PHP version supported by your version of Magento. For example, you should use PHP 5.5 with CE 1.9.1 or EE 1.14.1.</p>
<p>For more information about PHP, see:</p>
<ul><li><a href="http://php.net/ChangeLog-5.php#5.4.0" target="_blank">PHP 5.4 changelog</a></li>
<li><a href="http://php.net/ChangeLog-5.php#5.5.0" target="_blank">PHP 5.5 changelog</a></li></ul>
<p>Check with a system administrator or reference for your version of Ubuntu to see what PHP versions are available.</p>
<p>If you're installing Magento CE 1.9.1 or Magento EE 1.14.1, you can use PHP 5.5; otherwise, we recommend PHP 5.4. For certain versions of CE and EE, a <a href="{{ site.m1xgdeurl }}/other/php5.4_patch.html" target="_blank">patch</a> is required to use PHP 5.4.</p>
<p>Enter the following command to see what version of PHP is currently running:</p>
<pre>php -v</pre>
<p>See one of the following sections for more information:</p>
<ul><li><a href="#php-upgrade">Upgrading PHP</a></li>
<li><a href="#php-install-install">Installing PHP</a></li>
<li><a href="#php-extensions">Installing Required PHP Extensions</a></li>
<li><a href="#php-memory">Increasing the PHP memory Limit</a></li>
</ul>

<h3 id="php-upgrade">Upgrading PHP</h3>
<div class="msg-box important"><img src="{{ site.baseurl }}/guides/m1x/images/icon-important.png" alt="important" align="left" width="40"><span><strong>Important</strong>: The following sections discuss <em>suggested</em> PHP upgrade paths. Because you're choosing a non-Ubuntu repository to upgrade PHP, make your choice carefully. Not all repositories work equally well. We don't recommend any particular repository. Consult a system administrator or Ubuntu reference for more information.</span></div>

<p>To upgrade your version of PHP, see one of the following:</p>
<ul><li>Upgrade to PHP 5.5: <a href="http://php.net/manual/en/migration55.php" target="_blank">PHP site</a> and <a href="http://www.dev-metal.com/how-to-setup-latest-version-of-php-5-5-on-ubuntu-12-04-lts/" target="_blank">dev-metal</a>.</li>
<li>Upgrade to PHP 5.4: <a href="http://phpave.com/upgrade-php-5-3-php-5-5-ubuntu-12-04-lts/" target="_blank">phpave</a>.</li></ul>

<h3 id="php-install-install">Installing PHP</h3>
<p>See one of the following sections:</p>
<ul><li><a href="#php55-installub12">Installing PHP 5.5 on Ubuntu 12</a></li>
<li><a href="#php54-installub12">Installing PHP 5.4 on Ubuntu 12</a></li>
<li><a href="#php55-installub14">Installing PHP 5.5 on Ubuntu 14</a></li></ul>

<h4 id="php55-installub12">Installing PHP 5.5 on Ubuntu 12</h4>
<p>Use the following commands from <a href="http://www.dev-metal.com/how-to-setup-latest-version-of-php-5-5-on-ubuntu-12-04-lts/" target="_blank">dev-metal</a>:</p>
<pre>add-apt-repository ppa:ondrej/php5
apt-get update
sudo apt-get install php5</pre>

<h4 id="php54-installub12">Installing PHP 5.4 on Ubuntu 12</h4>
<p>Use the following commands from <a href="http://askubuntu.com/questions/109404/how-do-i-install-latest-php-in-supported-ubuntu-versions-like-5-4-x-in-ubuntu-1" target="_blank">askubuntu</a>:</p>
<pre>add-apt-repository ppa:ondrej/php5-oldstable
apt-get update
apt-get upgrade
apt-get install php5</pre>

<h4 id="php55-installub14">Installing PHP 5.5 on Ubuntu 14</h4>
<p>Enter the following command:</p>
<pre>apt-get -y install php5</pre>

<h3 id="php-extensions">Installing Required PHP Extensions</h3>
<p>Enter the following command to install PHP extensions required by Magento:</p>
<pre>apt-get -y install php5 php5-mhash php5-mcrypt php5-curl php5-cli php5-mysql php5-gd libapache2-mod-php5</pre>

<h3 id="php-memory">Increasing the PHP memory Limit</h3>
<p>Increase <code>memory_limit</code> in <code>php.ini</code> to at least 512MB:</p>
<ol><li>Open <code>/etc/php5/apache2/php.ini</code> in a text editor.</li>
<li>Change <code>memory_limit</code> to:
<pre>memory_limit = 512M</pre></li>
<li>Save your changes and exit the text editor.</li></ol>

<h2 id="mysql">MySQL</h2>
<p>Magento CE and EE support the following MySQL versions:</p>
<ul><li>Magento CE 1.9.1 and Magento EE 1.14.1 support MySQL versions 5.0.2 through 5.6.x. <br>
To install MySQL 5.6, see <a href="#mysql56">Installing MySQL 5.6</a>.</li>
<li>Magento CE versions 1.8.0.0&ndash;1.9.0.x support MySQL versions 4.1.20&ndash;5.5.x.<br>
To install MySQL version 5.5, see the next section.</li></ul>

<h3 id="mysql55">Installing MySQL 5.5</h3>
<p>Install the MySQL database:</p>
<pre>apt-get -y install mysql-client mysql-server</pre>

<h3 id="mysql56">Installing MySQL 5.6</h3>
<p>Only Magento CE 1.9.1 and EE 1.14.1 support MySQL 5.6. To install MySQL 5.6 on Ubuntu 14, see <a href="#mysql56ubu14">Installing MySQL 5.6 on Ubuntu 14</a>. To install MySQL 5.6 on Ubuntu 12, see the next section.</p>

<h4 id="mysql56ubu12">Installing MySQL 5.6 on Ubuntu 12</h4>
<p>To install MySQL 5.6 on Ubuntu 12, enter the following commands in the order shown:</p>
<pre>apt-add-repository ppa:ondrej/mysql-5.6
apt-get -y update
apt-get -y install mysql-server</pre>
<p>Test the installation by entering the following command:</p>
<pre>mysql -u root -p</pre>
<p>Messages similar to the following display:</p>
<pre>Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 43
Server version: 5.6.21-1+deb.sury.org~precise+1 (Ubuntu)

Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql></pre>

<h4 id="mysql56ubu14">Installing MySQL 5.6 on Ubuntu 14</h4>
<p>To install MySQL 5.6 on Ubuntu 14, enter the following command:</p>
<pre>apt-get -y install mysql-server-5.6 mysql-client-5.6</pre>
<p>Test the installation by entering the following command:</p>
<pre>Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 45
Server version: 5.6.19-0ubuntu0.14.04.1 (Ubuntu)

Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql></pre>


<h2 id="next">Next Steps</h2>
<p>After installing the required prerequisite software, continue your installation with <a href="{{ site.m1xgdeurl }}/install/installing_install.html#prepare">Preparing Your Server for Magento CE or EE</a>.</p>

</div>
</body>
</html>